<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script type="text/javascript" src="./js/ctx.js"></script>
</head>
<body>
<div id="cesiumContainer">
</div>
<div id="toolbar"></div>
<script>
    var initCesium = new InitCesium();
    var viewer = initCesium.initViewer('cesiumContainer', {
        terrainProvider: Cesium.createWorldTerrain()
    });
    // An example of using a b3dm tilset to classify another b3dm tileset.

    // A normal b3dm tileset of photogrammetry
    var tileset = new Cesium.Cesium3DTileset({
        url: Cesium.IonResource.fromAssetId(6074)
    });
    viewer.scene.primitives.add(tileset);
    viewer.zoomTo(tileset);

    var classifcationTilesetUrl = '../data/Cesium3DTiles/Classification/Photogrammetry/tileset.json';
    // A b3dm tileset used to classify the photogrammetry tileset
    var classificationTileset = new Cesium.Cesium3DTileset({
        url: classifcationTilesetUrl,
        classificationType: Cesium.ClassificationType.CESIUM_3D_TILE
    });
    classificationTileset.style = new Cesium.Cesium3DTileStyle({
        color: 'rgba(255, 0, 0, 0.5)'
    });
    viewer.scene.primitives.add(classificationTileset);

    // The same b3dm tileset used for classification, but rendered normally for comparison.
    var nonClassificationTileset = new Cesium.Cesium3DTileset({
        url: classifcationTilesetUrl,
        show: false
    });
    nonClassificationTileset.style = new Cesium.Cesium3DTileStyle({
        color: 'rgba(255, 0, 0, 0.5)'
    });
    viewer.scene.primitives.add(nonClassificationTileset);

    Sandcastle.addToggleButton('Show classification', true, function(checked) {
        classificationTileset.show = checked;
        nonClassificationTileset.show = !checked;
    });

</script>
</body>

</html>